package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.net.URLVariables;
	
	public class WebServer extends Sprite
	{
		private var loader1:URLLoader;
		private var loader2:URLLoader;
		private var vars:URLVariables = new URLVariables();
		private var request:URLRequest;
		
		public function WebServer()
		{
			loader1 = new URLLoader(new URLRequest("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName?theCityName=上海"));
			loader1.addEventListener(Event.COMPLETE,completeHandle1);
			
			vars.theCityName = "上海";
			request = new URLRequest("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName");
			request.method = "post";
			request.data = vars;
			
			loader2 = new URLLoader(request);
			loader2.addEventListener(Event.COMPLETE,completeHandle2);
		}
		
		private function completeHandle1(ev:Event):void
		{
			trace(loader1.data);
		}
		
		private function completeHandle2(ev:Event):void
		{
			trace(loader2.data);
		}
	}
}